package caiziyou.com.designpattern.facade.threater;

import caiziyou.com.designpattern.facade.device.Computer;
import caiziyou.com.designpattern.facade.device.Light;
import caiziyou.com.designpattern.facade.device.Player;
import caiziyou.com.designpattern.facade.device.PopcornPopper;
import caiziyou.com.designpattern.facade.device.Projector;

/**
 * 家庭影院
 * 
 * @author caijianchao
 * @date 2020年5月13日 HomeThreaterFacade.java
 */
public class HomeTheaterFacade {
	private Computer computer = new Computer();
	private Light light = new Light();
	private Player player = new Player();
	private PopcornPopper popcornPopper = new PopcornPopper();
	private Projector projector = new Projector();

	public HomeTheaterFacade() {
		super();
	}

	public HomeTheaterFacade(Computer computer, Light light, Player player, PopcornPopper popcornPopper,
			Projector projector) {
		this.computer = computer;
		this.light = light;
		this.player = player;
		this.popcornPopper = popcornPopper;
		this.projector = projector;
	}

	/**
	 * 一键观影
	 */
	public void watchMovie() {
		computer.on();
		light.down();
		popcornPopper.on();
		popcornPopper.makePopPoper();
		projector.on();
		projector.down();
		player.on();
		player.make3DListener();
	}

	/**
	 * 一键关闭
	 */
	public void stopMovie() {
		computer.off();
		light.up();
		player.off();
		popcornPopper.off();
		projector.up();
		projector.off();
	}
}
